import {defineConfig} from 'vite'
import {VantResolver} from "@vant/auto-import-resolver";
import vue from '@vitejs/plugin-vue';
import AutoImport from 'unplugin-auto-import/vite';
import Components from 'unplugin-vue-components/vite';


export default defineConfig({
    base: './',
    plugins: [vue(),
        AutoImport({
            resolvers: [VantResolver()],
        }),
        Components({
            resolvers: [VantResolver()],
        }),
    ],

    server: {
        host: '0.0.0.0',
        port: 5730,
        proxy: {
            '/api': {
                target: 'http://localhost:8080',
                ws: true,
                changeOrigin: true,
                rewrite: path => path.replace(/^\/api/, '')
            }
        },

    }
})
